//
//  KKHomeVController.swift
//  MVVMSwfit
//
//  Created by CarShare on 2018/12/3.
//  Copyright © 2018年 CarShare. All rights reserved.
//

import UIKit

class KKHomeVController: KKBaseVController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
//        self.title = "首页"

        self.configUISubviews()

    }
}
//MARK: --- UITableViewDataSource
extension KKHomeVController{
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 3
    }
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let cell:KKHomeTableCell = tableView.dequeueReusableCell(withIdentifier: NSStringFromClass(KKHomeTableCell.self), for: indexPath) as! KKHomeTableCell
        
        return cell
    }
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 50.0
    }
}
extension KKHomeVController{
    func configUISubviews() -> Void {
        
        self.configTableView(tableFrame: CGRect(x: 0, y: -UIApplication.shared.statusBarFrame.height, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height - 44 - 34),cellClass: KKHomeTableCell.self)
        
        let topView:KKHomeTopView = KKHomeTopView.init(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 486))
        
        tableView?.tableHeaderView = topView
    }
}
